/*     */ package com.umeng.fb;
/*     */ 
/*     */ import android.app.Activity;
/*     */ import android.content.Context;
/*     */ import android.os.Bundle;
/*     */ import android.view.LayoutInflater;
/*     */ import android.view.View;
/*     */ import android.view.View.MeasureSpec;
/*     */ import android.view.ViewGroup;
/*     */ import android.view.ViewGroup.LayoutParams;
/*     */ import android.widget.BaseAdapter;
/*     */ import android.widget.EditText;
/*     */ import android.widget.ListView;
/*     */ import android.widget.RelativeLayout;
/*     */ import android.widget.RelativeLayout.LayoutParams;
/*     */ import android.widget.TextView;
/*     */ import com.umeng.fb.b.b;
/*     */ import com.umeng.fb.b.c;
/*     */ import com.umeng.fb.model.Conversation;
/*     */ import com.umeng.fb.model.DevReply;
/*     */ import com.umeng.fb.model.Reply;
/*     */ import java.text.DateFormat;
/*     */ import java.text.SimpleDateFormat;
/*     */ import java.util.List;
/*     */ 
/*     */ public class ConversationActivity extends Activity
/*     */ {
/*  32 */   private static final String e = ConversationActivity.class.getName();
/*     */   private FeedbackAgent f;
/*     */   private Conversation g;
/*     */   private a h;
/*     */   private ListView i;
/*     */   RelativeLayout a;
/*     */   int b;
/*     */   int c;
/*     */   EditText d;
/*     */   private int j;
/*     */ 
/*     */   protected void onCreate(Bundle paramBundle)
/*     */   {
/*  45 */     super.onCreate(paramBundle);
/*  46 */     setContentView(
/*  47 */       com.umeng.fb.b.d.b(this));
/*     */     try {
/*  49 */       this.f = new FeedbackAgent(this);
/*  50 */       this.g = this.f.getDefaultConversation();
/*     */ 
/*  52 */       this.i = ((ListView)findViewById(
/*  53 */         c.a(this)));
/*     */ 
/*  55 */       b();
/*     */ 
/*  57 */       this.h = new a(this);
/*  58 */       this.i.setAdapter(this.h);
/*     */ 
/*  61 */       a();
/*     */ 
/*  64 */       View localView = findViewById(
/*  65 */         c.c(this));
/*     */ 
/*  67 */       localView.setOnClickListener(new d(this));
/*     */ 
/*  94 */       if (this.f.getUserInfoLastUpdateAt() > 0L) {
/*  95 */         localView.setVisibility(8);
/*     */       }
/*  97 */       findViewById(c.d(this))
/*  98 */         .setOnClickListener(new f(this));
/*     */ 
/* 106 */       this.d = ((EditText)findViewById(
/* 107 */         c.b(this)));
/*     */ 
/* 109 */       findViewById(c.e(this))
/* 110 */         .setOnClickListener(new g(this));
/*     */     }
/*     */     catch (Exception localException)
/*     */     {
/* 139 */       localException.printStackTrace();
/* 140 */       finish();
/*     */     }
/*     */   }
/*     */ 
/*     */   private void b()
/*     */   {
/* 146 */     LayoutInflater localLayoutInflater = (LayoutInflater)getSystemService("layout_inflater");
/* 147 */     this.a = ((RelativeLayout)localLayoutInflater.inflate(
/* 148 */       com.umeng.fb.b.d.e(this), 
/* 149 */       this.i, false));
/*     */ 
/* 151 */     this.i.addHeaderView(this.a);
/* 152 */     a(this.a);
/* 153 */     this.b = this.a.getMeasuredHeight();
/* 154 */     this.c = this.a.getPaddingTop();
/*     */ 
/* 156 */     this.a.setPadding(this.a.getPaddingLeft(), -this.b, 
/* 157 */       this.a.getPaddingRight(), this.a.getPaddingBottom());
/* 158 */     this.a.setVisibility(8);
/*     */ 
/* 160 */     this.i.setOnTouchListener(new h(this));
/*     */ 
/* 223 */     this.i.setOnScrollListener(new i(this));
/*     */   }
/*     */ 
/*     */   private void a(View paramView)
/*     */   {
/* 245 */     ViewGroup.LayoutParams localLayoutParams = paramView.getLayoutParams();
/* 246 */     if (localLayoutParams == null) {
/* 247 */       localLayoutParams = new ViewGroup.LayoutParams(-1, 
/* 248 */         -2);
/*     */     }
/*     */ 
/* 251 */     int k = ViewGroup.getChildMeasureSpec(0, 0, localLayoutParams.width);
/* 252 */     int m = localLayoutParams.height;
/*     */     int n;
/* 254 */     if (m > 0)
/* 255 */       n = View.MeasureSpec.makeMeasureSpec(m, 
/* 256 */         1073741824);
/*     */     else {
/* 258 */       n = View.MeasureSpec.makeMeasureSpec(0, 
/* 259 */         0);
/*     */     }
/* 261 */     paramView.measure(k, n);
/*     */   }
/*     */ 
/*     */   void a() {
/* 265 */     j localj = new j(this);
/*     */ 
/* 276 */     this.g.sync(localj);
/*     */   }
/*     */ 
/*     */   class a extends BaseAdapter
/*     */   {
/*     */     Context a;
/*     */     LayoutInflater b;
/*     */ 
/*     */     public a(Context arg2)
/*     */     {
/*     */       Object localObject;
/* 284 */       this.a = localObject;
/* 285 */       this.b = LayoutInflater.from(this.a);
/*     */     }
/*     */ 
/*     */     public int getCount()
/*     */     {
/* 290 */       List localList = ConversationActivity.a(ConversationActivity.this).getReplyList();
/* 291 */       return localList == null ? 0 : localList.size();
/*     */     }
/*     */ 
/*     */     public View getView(int paramInt, View paramView, ViewGroup paramViewGroup)
/*     */     {
/*     */       a locala;
/* 304 */       if (paramView == null) {
/* 305 */         paramView = this.b.inflate(
/* 306 */           com.umeng.fb.b.d.c(this.a), null);
/*     */ 
/* 308 */         locala = new a();
/*     */ 
/* 310 */         locala.a = 
/* 311 */           ((TextView)paramView
/* 311 */           .findViewById(
/* 312 */           c.f(this.a)));
/*     */ 
/* 314 */         locala.b = 
/* 315 */           ((TextView)paramView
/* 315 */           .findViewById(
/* 316 */           c.b(this.a)));
/*     */ 
/* 318 */         paramView.setTag(locala);
/*     */       } else {
/* 320 */         locala = (a)paramView.getTag();
/*     */       }
/*     */ 
/* 323 */       Reply localReply = (Reply)ConversationActivity.a(ConversationActivity.this).getReplyList().get(paramInt);
/*     */ 
/* 325 */       RelativeLayout.LayoutParams localLayoutParams = new RelativeLayout.LayoutParams(
/* 326 */         -2, 
/* 327 */         -2);
/*     */ 
/* 329 */       if ((localReply instanceof DevReply)) {
/* 330 */         localLayoutParams.addRule(9);
/* 331 */         locala.b.setLayoutParams(localLayoutParams);
/*     */ 
/* 334 */         locala.b
/* 335 */           .setBackgroundResource(
/* 336 */           b.b(this.a));
/*     */       } else {
/* 338 */         localLayoutParams.addRule(11);
/*     */ 
/* 340 */         locala.b.setLayoutParams(localLayoutParams);
/* 341 */         locala.b
/* 342 */           .setBackgroundResource(
/* 343 */           b.a(this.a));
/*     */       }
/*     */ 
/* 346 */       locala.a.setText(SimpleDateFormat.getDateTimeInstance()
/* 347 */         .format(localReply.getDatetime()));
/* 348 */       locala.b.setText(localReply.getContent());
/* 349 */       return paramView;
/*     */     }
/*     */ 
/*     */     public Object getItem(int paramInt)
/*     */     {
/* 359 */       return ConversationActivity.a(ConversationActivity.this).getReplyList().get(paramInt);
/*     */     }
/*     */ 
/*     */     public long getItemId(int paramInt)
/*     */     {
/* 369 */       return paramInt;
/*     */     }
/*     */ 
/*     */     class a
/*     */     {
/*     */       TextView a;
/*     */       TextView b;
/*     */ 
/*     */       a()
/*     */       {
/*     */       }
/*     */     }
/*     */   }
/*     */ }

/* Location:           C:\Users\Administrator\Desktop\umeng_sdk.jar
 * Qualified Name:     com.umeng.fb.ConversationActivity
 * JD-Core Version:    0.6.2
 */